<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>李宁体育</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="<%=path%>/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="<%=path%>/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="<%=path%>/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="<%=path%>/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="<%=path%>/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="<%=path%>/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="<%=path%>/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="<%=path%>/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
          rel="stylesheet">
    <link href="<%=path%>/css/animate.min.css" rel="stylesheet">
    <link href="<%=path%>/css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>
<style>
.label-txt{
	text-align:left !important;
	padding-left:60px;
}
.txt-msg{
	margin-top:7px;
}

</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>报名参数配置</h5>                 
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" action="saveActivityApply.do" method="post" id="activityApplyForm">
                        <input type="hidden" value="${id}"   name="activityId" id="activityId"></input>
                        <input type="hidden" name="typeCode" id="typeCode"></input>
                        <div class="form-group">
                                    <c:forEach items="${list}" var="applyConfig">
                                      <c:if test="${applyConfig.type == 1}">
                                         <div class="form-group" ">                                  
										 <label class="col-sm-2 control-label label-txt" ><input name="codeType" id="codeType" type="checkbox" value="${applyConfig.code}-${applyConfig.name}"  <c:if test="${applyConfig.flag == '1'}">checked</c:if>/>&nbsp;&nbsp;&nbsp;&nbsp;${applyConfig.name}：</label>
										 <div class="col-sm-3 txt-msg" >
                                                    (单行文本)     
										 </div>
									     </div>
                                      </c:if>
                                      <c:if test="${applyConfig.type == 2}">
                                         <div class="form-group">                                         
										 <label class="col-sm-2 control-label label-txt"><input name="codeType" id="codeType" type="checkbox" value="${applyConfig.code}-${applyConfig.name}" <c:if test="${applyConfig.flag == '1'}">checked</c:if>/>&nbsp;&nbsp;&nbsp;&nbsp;${applyConfig.name}：</label>
										 <div class="col-sm-3  txt-msg">
                                                    (多行文本)      
										 </div>
									     </div>
                                      </c:if>
                                      <c:if test="${applyConfig.type == 3}">
                                         <div class="form-group">                                         
										 <label class="col-sm-2 control-label label-txt"><input name="codeType" id="codeType" type="checkbox" value="${applyConfig.code}-${applyConfig.name}" <c:if test="${applyConfig.flag == '1'}">checked</c:if>/>&nbsp;&nbsp;&nbsp;&nbsp;${applyConfig.name}：</label>
										 <div class="col-sm-3  txt-msg">
                                                    (单选)      
										 </div>
									     </div>
                                      </c:if>
                                      <c:if test="${applyConfig.type == 4}">
                                         <div class="form-group">                                         
										 <label class="col-sm-2 control-label label-txt"><input name="codeType" id="codeType" type="checkbox" value="${applyConfig.code}-${applyConfig.name}" <c:if test="${applyConfig.flag == '1'}">checked</c:if>/>&nbsp;&nbsp;&nbsp;&nbsp;${applyConfig.name}：</label>
										 <div class="col-sm-3  txt-msg">
                                                    (多选)      
										 </div>
									     </div>
                                      </c:if>
									</c:forEach> 						
									<div class="form-group">
                                         <div class="col-sm-4 col-sm-offset-3">
                                            <button class="btn btn-primary" type="button" onclick="activityApply();">提  交</button>
                                            &nbsp;<button class="btn btn-info" type="button" onclick="goback()">返 回</button>
                                         </div>
                                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<%=path%>/js/jquery.min.js?v=2.1.4"></script>
<script src="<%=path%>/js/bootstrapValidator.min.js"></script>
<!--下拉框-->
<script src="<%=path%>/js/plugins/chosen/chosen.jquery.js"></script>
<script>
    function goback() {
        window.location.href="<%=path%>/vipActivity/queryVipActivityList";
    }
    function activityApply(){
    	var obj=document.getElementsByName('codeType'); 
    	var val='';
    	for(var i=0; i<obj.length; i++){
    	    if(obj[i].checked) val+=obj[i].value+',';
    	} 
    	$("#typeCode").val(val);
    	var pdval = $("#typeCode").val();
    	if(pdval==''||pdval==null){
    		alert("请设置报名参数");
    		return;
    	}else{
    		$("#activityApplyForm").submit();
    	}
    }
</script>
</body>
</html>
